package com.common.www.service.project;


import com.common.www.bean.entity.project.SupplyCompany;
import com.common.www.bean.entity.project.XfgcBiddingCompany;
import com.common.www.bean.entity.tabulation.XfgcBidBaseTabulation;
import com.common.www.bean.entity.tabulation.XfgcTabulation;
import com.common.www.bean.vo.xfgc.*;
import com.common.www.service.tabulation.XfgcBidBaseTabulationService;
import com.common.www.service.tabulation.XfgcTabulationService;
import org.apache.commons.beanutils.BeanUtils;
import org.apache.commons.lang3.StringUtils;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddress;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.lang.reflect.InvocationTargetException;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.*;
import java.util.stream.Collectors;


@Service
@Transactional
public class StatisticalAnalysisXfgcService {

    @Autowired
    private XfgcBidBaseTabulationService xfgcBidBaseTabulationService;
    @Autowired
    private XfgcTabulationService xfgcTabulationService;
    @Autowired
    private SupplyCompanyService supplyCompanyService;
    @Autowired
    private ProjectService projectService;
    @Autowired
    private XfgcBiddingCompanyService biddingCompanyService;


    /**
     * 综合单价对比分析
     *
     * @param companyList
     * @param projectId
     * @param jieDuan
     * @return
     */
    public List<XfgcComprehensiveUnitPriceCollectVo> getComprehensiveUnitPrice(List<XfgcBiddingCompany> companyList, Long projectId, Integer jieDuan) throws InvocationTargetException, IllegalAccessException {
        List<XfgcBidBaseTabulation> xfgcBidBaseTabulationList = xfgcBidBaseTabulationService.getRepository().findByFlagAndProjectId(1, projectId);

        List<XfgcComprehensiveUnitPriceStatisVo> bdVoList = new ArrayList<>();
        for (XfgcBidBaseTabulation bidBaseTabulation : xfgcBidBaseTabulationList) {
            //工程量为0为null的不显示(不计算)
            if (bidBaseTabulation.getGongChengLiangHuiZong() == null || bidBaseTabulation.getGongChengLiangHuiZong().longValue() == 0){
                continue;
            }
            XfgcComprehensiveUnitPriceStatisVo bdVo = new XfgcComprehensiveUnitPriceStatisVo();
            bdVo.setSort(1);
            bdVo.setBiddingNameC("标底");
            bdVo.setId(bidBaseTabulation.getId());
            bdVo.setNameType1(bidBaseTabulation.getNameType1());
            bdVo.setNameType2(bidBaseTabulation.getNameType2());
            bdVo.setName(bidBaseTabulation.getName());
            bdVo.setXiTongFenLei(bidBaseTabulation.getXiTongFenLei());
            bdVo.setCodeNumber(bidBaseTabulation.getCodeNumber());
            bdVo.setCodeNumberType(bidBaseTabulation.getCodeNumberType());
            bdVo.setTeZhengNeiRong(bidBaseTabulation.getTeZhengNeiRong());
            bdVo.setUnit(bidBaseTabulation.getUnit());
            bdVo.setGongChengLiang(bidBaseTabulation.getGongChengLiangHuiZong());
            bdVo.setRenGongCost(bidBaseTabulation.getRenGongCost());
            bdVo.setZhuCaiCost(bidBaseTabulation.getZhuCaiCost());
            bdVo.setFuCaiCost(bidBaseTabulation.getFuCaiCost());
            bdVo.setJiXieCost(bidBaseTabulation.getJiXieCost());
            bdVo.setQiYeCost(bidBaseTabulation.getQiYeCost());
            bdVo.setShuiJin(bidBaseTabulation.getShuiJin());
            bdVo.setQiYeCostFillIn(bidBaseTabulation.getQiYeCostFillIn());
            bdVo.setShuiJinFillIn(bidBaseTabulation.getShuiJinFillIn());
            bdVo.setComprehensivePriceHs(bidBaseTabulation.getComprehensivePriceHs());
            bdVo.setTotalPriceHs(bidBaseTabulation.getTotalPriceHs());
            bdVoList.add(bdVo);
        }

        List<XfgcComprehensiveUnitPriceStatisVo> gsVoList = new ArrayList<>();
        Integer sort = 1;
        for (XfgcBiddingCompany company : companyList) {
            List<XfgcTabulation> xfgcTabulationList = xfgcTabulationService.getRepository().findByFlagAndXfgcBiddingCompanyIdAndJieDuan(1, company.getId(), jieDuan);
            if (xfgcTabulationList.size() == 0) {
                continue;
            }
            sort++;
            for (XfgcTabulation tabulation : xfgcTabulationList) {
//                if (tabulation.getGongChengLiangHuiZong() == null || tabulation.getGongChengLiangHuiZong().longValue() == 0){
//                    continue;
//                }
                XfgcComprehensiveUnitPriceStatisVo gsVo = new XfgcComprehensiveUnitPriceStatisVo();
                gsVo.setSort(sort);
                gsVo.setBiddingNameC(tabulation.getXfgcBiddingCompany().getSupplyCompany().getName());
                gsVo.setId(tabulation.getId());
                gsVo.setNameType1(tabulation.getNameType1());
                gsVo.setNameType2(tabulation.getNameType2());
                gsVo.setName(tabulation.getName());
                gsVo.setXiTongFenLei(tabulation.getXiTongFenLei());
                gsVo.setBiddingCompany(tabulation.getXfgcBiddingCompany());
                gsVo.setCodeNumber(tabulation.getCodeNumber());
                gsVo.setCodeNumberType(tabulation.getCodeNumberType());
                gsVo.setTeZhengNeiRong(tabulation.getTeZhengNeiRong());
                gsVo.setUnit(tabulation.getUnit());
                gsVo.setGongChengLiang(tabulation.getGongChengLiangHuiZong());
                gsVo.setRenGongCost(tabulation.getRenGongCost());
                gsVo.setZhuCaiCost(tabulation.getZhuCaiCost());
                gsVo.setFuCaiCost(tabulation.getFuCaiCost());
                gsVo.setJiXieCost(tabulation.getJiXieCost());
                gsVo.setQiYeCost(tabulation.getQiYeCost());
                gsVo.setShuiJin(tabulation.getShuiJin());
                gsVo.setQiYeCostFillIn(tabulation.getQiYeCostFillIn());
                gsVo.setShuiJinFillIn(tabulation.getShuiJinFillIn());
                gsVo.setComprehensivePriceHs(tabulation.getComprehensivePriceHs());
                gsVo.setTotalPriceHs(tabulation.getTotalPriceHs());
                gsVo.setChaYiRemark(tabulation.getChaYiRemark());
                //计算‘含税综合单价’、‘含税合价’
                CalculateXfgcPriceVo priceVo = calculatePrice(tabulation);
                gsVo.setCalculateComprehensivePriceHs(priceVo.getCalculateComprehensivePriceHs());
                gsVo.setCalculateTotalPrice(priceVo.getCalculateTotalPriceHs());
                gsVoList.add(gsVo);
            }
        }

        List<XfgcComprehensiveUnitPriceStatisVo> minGsVoList = new ArrayList<>();
        Map<String, List<XfgcComprehensiveUnitPriceStatisVo>> classificationCodeInList = gsVoList.stream().collect(Collectors.groupingBy(XfgcComprehensiveUnitPriceStatisVo::getCodeNumber));
        for (Map.Entry<String, List<XfgcComprehensiveUnitPriceStatisVo>> item : classificationCodeInList.entrySet()) {
            String code = item.getKey();
            List<XfgcComprehensiveUnitPriceStatisVo> value = item.getValue();
            XfgcComprehensiveUnitPriceStatisVo minGsVo = new XfgcComprehensiveUnitPriceStatisVo(); // 初始化
            BigDecimal minComprehensivePrice = BigDecimal.valueOf(Long.MAX_VALUE); // 初始化为最大值

            for (XfgcComprehensiveUnitPriceStatisVo statisVo : value) {
                BigDecimal tempComprehensivePrice = statisVo.getCalculateComprehensivePriceHs();
                // 检查当前vo的comprehensivePrice是否小于当前记录的最小值
                if (tempComprehensivePrice.compareTo(minComprehensivePrice) < 0) {
                    minComprehensivePrice = tempComprehensivePrice;
                    BeanUtils.copyProperties(minGsVo, statisVo);
                }
            }
            if (minGsVo != null) { // 确保至少有一个元素
                minGsVoList.add(minGsVo);
            }
        }

        //计算 偏离百分比
        List<XfgcComprehensiveUnitPriceStatisVo> valueTbList = new ArrayList<>();
        for (XfgcComprehensiveUnitPriceStatisVo vo : gsVoList) {
            for (XfgcComprehensiveUnitPriceStatisVo tempBd : bdVoList) {
                //较标底偏离百分比
                if (vo.getCodeNumber().equals(tempBd.getCodeNumber())) {
                    if (vo.getCalculateComprehensivePriceHs() != null && tempBd.getComprehensivePriceHs() != null && tempBd.getComprehensivePriceHs().compareTo(BigDecimal.ZERO) != 0) {
                        BigDecimal biaoDi = vo.getCalculateComprehensivePriceHs().subtract(tempBd.getComprehensivePriceHs()).divide(tempBd.getComprehensivePriceHs(), RoundingMode.HALF_UP);
                        vo.setBiaoDi(biaoDi);
                    }
                }
            }
            for (XfgcComprehensiveUnitPriceStatisVo tempGs : minGsVoList) {
                //较本轮回标偏离百分比
                if (vo.getCodeNumber().equals(tempGs.getCodeNumber())) {
                    if (vo.getCalculateComprehensivePriceHs() != null && tempGs.getCalculateComprehensivePriceHs() != null && tempGs.getCalculateComprehensivePriceHs().compareTo(BigDecimal.ZERO) != 0) {
//                        BigDecimal huiBiao = vo.getCalculateComprehensivePriceHs().divide(tempGs.getCalculateComprehensivePriceHs(), RoundingMode.HALF_UP);
                        BigDecimal huiBiao = vo.getCalculateComprehensivePriceHs().subtract(tempGs.getCalculateComprehensivePriceHs()).divide(vo.getCalculateComprehensivePriceHs(), RoundingMode.HALF_UP);
                        vo.setHuiBiao(huiBiao);
                    }
                }
            }
            valueTbList.add(vo);
        }

        //将标底加入valueTbList
        valueTbList.addAll(0, bdVoList);
        List<XfgcComprehensiveUnitPriceStatisVo> sortedList = valueTbList.stream().sorted(Comparator.comparingInt(XfgcComprehensiveUnitPriceStatisVo::getSort)
                .thenComparing(XfgcComprehensiveUnitPriceStatisVo::getCodeNumber)).collect(Collectors.toList());

        //数据结构形式转换
        List<XfgcComprehensiveUnitPriceCollectVo> collectVoList = new ArrayList<>();
        Map<String, List<XfgcComprehensiveUnitPriceStatisVo>> tempMap = sortedList.stream().collect(Collectors.groupingBy(XfgcComprehensiveUnitPriceStatisVo::getCodeNumber));
        for (Map.Entry<String, List<XfgcComprehensiveUnitPriceStatisVo>> item : tempMap.entrySet()) {
            String name = item.getKey();
            List<XfgcComprehensiveUnitPriceStatisVo> value = item.getValue();
            XfgcComprehensiveUnitPriceCollectVo collectVo = new XfgcComprehensiveUnitPriceCollectVo();
            for (XfgcComprehensiveUnitPriceStatisVo statisVo : value) {
                if (statisVo.getSort() == 1) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId(statisVo.getId());
                    collectVo.setBiddingNameC(statisVo.getBiddingNameC());
                    collectVo.setNameType1(statisVo.getNameType1());
                    collectVo.setNameType2(statisVo.getNameType2());
                    collectVo.setName(statisVo.getName());
                    collectVo.setXiTongFenLei(statisVo.getXiTongFenLei());
                    collectVo.setCodeNumber(statisVo.getCodeNumber());
                    collectVo.setCodeNumberType(statisVo.getCodeNumberType());
                    collectVo.setTeZhengNeiRong(statisVo.getTeZhengNeiRong());
                    collectVo.setUnit(statisVo.getUnit());
                    collectVo.setGongChengLiang(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost(statisVo.getJiXieCost());
                    collectVo.setQiYeCost(statisVo.getQiYeCost());
                    collectVo.setShuiJin(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice(statisVo.getTotalPriceHs());
                }
                if (statisVo.getSort() == 2) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId1(statisVo.getId());
                    collectVo.setBiddingNameC1(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei1(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost1(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost1(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost1(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost1(statisVo.getJiXieCost());
                    collectVo.setQiYeCost1(statisVo.getQiYeCost());
                    collectVo.setShuiJin1(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn1(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn1(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice1(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice1(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs1(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice1(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi1(statisVo.getBiaoDi());
                    collectVo.setHuiBiao1(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark1(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 3) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId2(statisVo.getId());
                    collectVo.setBiddingNameC2(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei2(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost2(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost2(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost2(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost2(statisVo.getJiXieCost());
                    collectVo.setQiYeCost2(statisVo.getQiYeCost());
                    collectVo.setShuiJin2(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn2(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn2(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice2(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice2(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs2(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice2(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi2(statisVo.getBiaoDi());
                    collectVo.setHuiBiao2(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark2(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 4) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId3(statisVo.getId());
                    collectVo.setBiddingNameC3(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei3(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost3(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost3(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost3(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost3(statisVo.getJiXieCost());
                    collectVo.setQiYeCost3(statisVo.getQiYeCost());
                    collectVo.setShuiJin3(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn3(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn3(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice3(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice3(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs3(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice3(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi3(statisVo.getBiaoDi());
                    collectVo.setHuiBiao3(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark3(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 5) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId4(statisVo.getId());
                    collectVo.setBiddingNameC4(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei4(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost4(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost4(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost4(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost4(statisVo.getJiXieCost());
                    collectVo.setQiYeCost4(statisVo.getQiYeCost());
                    collectVo.setShuiJin4(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn4(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn4(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice4(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice4(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs4(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice4(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi4(statisVo.getBiaoDi());
                    collectVo.setHuiBiao4(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark4(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 6) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId5(statisVo.getId());
                    collectVo.setBiddingNameC5(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei5(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost5(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost5(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost5(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost5(statisVo.getJiXieCost());
                    collectVo.setQiYeCost5(statisVo.getQiYeCost());
                    collectVo.setShuiJin5(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn5(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn5(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice5(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice5(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs5(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice5(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi5(statisVo.getBiaoDi());
                    collectVo.setHuiBiao5(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark5(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 7) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId6(statisVo.getId());
                    collectVo.setBiddingNameC6(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei6(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost6(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost6(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost6(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost6(statisVo.getJiXieCost());
                    collectVo.setQiYeCost6(statisVo.getQiYeCost());
                    collectVo.setShuiJin6(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn6(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn6(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice6(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice6(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs6(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice6(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi6(statisVo.getBiaoDi());
                    collectVo.setHuiBiao6(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark6(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 8) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId7(statisVo.getId());
                    collectVo.setBiddingNameC7(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei7(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost7(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost7(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost7(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost7(statisVo.getJiXieCost());
                    collectVo.setQiYeCost7(statisVo.getQiYeCost());
                    collectVo.setShuiJin7(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn7(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn7(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice7(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice7(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs7(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice7(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi7(statisVo.getBiaoDi());
                    collectVo.setHuiBiao7(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark7(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 9) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId8(statisVo.getId());
                    collectVo.setBiddingNameC8(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei8(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost8(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost8(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost8(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost8(statisVo.getJiXieCost());
                    collectVo.setQiYeCost8(statisVo.getQiYeCost());
                    collectVo.setShuiJin8(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn8(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn8(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice8(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice8(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs8(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice8(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi8(statisVo.getBiaoDi());
                    collectVo.setHuiBiao8(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark8(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 10) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId9(statisVo.getId());
                    collectVo.setBiddingNameC9(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei9(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost9(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost9(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost9(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost9(statisVo.getJiXieCost());
                    collectVo.setQiYeCost9(statisVo.getQiYeCost());
                    collectVo.setShuiJin9(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn9(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn9(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice9(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice9(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs9(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice9(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi9(statisVo.getBiaoDi());
                    collectVo.setHuiBiao9(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark9(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 11) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId10(statisVo.getId());
                    collectVo.setBiddingNameC10(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei10(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost10(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost10(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost10(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost10(statisVo.getJiXieCost());
                    collectVo.setQiYeCost10(statisVo.getQiYeCost());
                    collectVo.setShuiJin10(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn10(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn10(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice10(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice10(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs10(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice10(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi10(statisVo.getBiaoDi());
                    collectVo.setHuiBiao10(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark10(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 12) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId11(statisVo.getId());
                    collectVo.setBiddingNameC11(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei11(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost11(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost11(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost11(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost11(statisVo.getJiXieCost());
                    collectVo.setQiYeCost11(statisVo.getQiYeCost());
                    collectVo.setShuiJin11(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn11(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn11(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice11(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice11(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs11(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice11(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi11(statisVo.getBiaoDi());
                    collectVo.setHuiBiao11(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark11(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 13) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId12(statisVo.getId());
                    collectVo.setBiddingNameC12(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei12(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost12(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost12(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost12(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost12(statisVo.getJiXieCost());
                    collectVo.setQiYeCost12(statisVo.getQiYeCost());
                    collectVo.setShuiJin12(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn12(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn12(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice12(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice12(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs12(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice12(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi12(statisVo.getBiaoDi());
                    collectVo.setHuiBiao12(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark12(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 14) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId13(statisVo.getId());
                    collectVo.setBiddingNameC13(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei13(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost13(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost13(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost13(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost13(statisVo.getJiXieCost());
                    collectVo.setQiYeCost13(statisVo.getQiYeCost());
                    collectVo.setShuiJin13(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn13(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn13(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice13(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice13(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs13(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice13(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi13(statisVo.getBiaoDi());
                    collectVo.setHuiBiao13(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark13(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 15) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId14(statisVo.getId());
                    collectVo.setBiddingNameC14(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei14(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost14(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost14(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost14(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost14(statisVo.getJiXieCost());
                    collectVo.setQiYeCost14(statisVo.getQiYeCost());
                    collectVo.setShuiJin14(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn14(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn14(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice14(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice14(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs14(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice14(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi14(statisVo.getBiaoDi());
                    collectVo.setHuiBiao14(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark14(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 16) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId15(statisVo.getId());
                    collectVo.setBiddingNameC15(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei15(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost15(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost15(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost15(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost15(statisVo.getJiXieCost());
                    collectVo.setQiYeCost15(statisVo.getQiYeCost());
                    collectVo.setShuiJin15(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn15(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn15(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice15(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice15(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs15(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice15(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi15(statisVo.getBiaoDi());
                    collectVo.setHuiBiao15(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark15(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 17) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId16(statisVo.getId());
                    collectVo.setBiddingNameC16(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei16(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost16(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost16(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost16(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost16(statisVo.getJiXieCost());
                    collectVo.setQiYeCost16(statisVo.getQiYeCost());
                    collectVo.setShuiJin16(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn16(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn16(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice16(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice16(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs16(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice16(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi16(statisVo.getBiaoDi());
                    collectVo.setHuiBiao16(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark16(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 18) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId17(statisVo.getId());
                    collectVo.setBiddingNameC17(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei17(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost17(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost17(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost17(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost17(statisVo.getJiXieCost());
                    collectVo.setQiYeCost17(statisVo.getQiYeCost());
                    collectVo.setShuiJin17(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn17(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn17(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice17(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice17(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs17(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice17(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi17(statisVo.getBiaoDi());
                    collectVo.setHuiBiao17(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark17(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 19) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId18(statisVo.getId());
                    collectVo.setBiddingNameC18(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei18(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost18(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost18(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost18(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost18(statisVo.getJiXieCost());
                    collectVo.setQiYeCost18(statisVo.getQiYeCost());
                    collectVo.setShuiJin18(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn18(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn18(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice18(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice18(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs18(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice18(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi18(statisVo.getBiaoDi());
                    collectVo.setHuiBiao18(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark18(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 20) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId19(statisVo.getId());
                    collectVo.setBiddingNameC19(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei19(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost19(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost19(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost19(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost19(statisVo.getJiXieCost());
                    collectVo.setQiYeCost19(statisVo.getQiYeCost());
                    collectVo.setShuiJin19(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn19(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn19(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice19(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice19(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs19(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice19(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi19(statisVo.getBiaoDi());
                    collectVo.setHuiBiao19(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark19(statisVo.getChaYiRemark());
                }
                if (statisVo.getSort() == 21) {
                    collectVo.setSort(statisVo.getSort());
                    collectVo.setId20(statisVo.getId());
                    collectVo.setBiddingNameC20(statisVo.getBiddingNameC());
                    collectVo.setXiTongFenLei20(statisVo.getXiTongFenLei());
                    collectVo.setRenGongCost20(statisVo.getRenGongCost());
                    collectVo.setZhuCaiCost20(statisVo.getZhuCaiCost());
                    collectVo.setFuCaiCost20(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost20(statisVo.getJiXieCost());
                    collectVo.setQiYeCost20(statisVo.getQiYeCost());
                    collectVo.setShuiJin20(statisVo.getShuiJin());
                    collectVo.setQiYeCostFillIn20(statisVo.getQiYeCostFillIn());
                    collectVo.setShuiJinFillIn20(statisVo.getShuiJinFillIn());
                    collectVo.setComprehensivePrice20(statisVo.getComprehensivePriceHs());
                    collectVo.setTotalPrice20(statisVo.getTotalPriceHs());
                    collectVo.setCalculateComprehensivePriceHs20(statisVo.getCalculateComprehensivePriceHs());
                    collectVo.setCalculateTotalPrice20(statisVo.getCalculateTotalPrice());
                    collectVo.setBiaoDi20(statisVo.getBiaoDi());
                    collectVo.setHuiBiao20(statisVo.getHuiBiao());
                    collectVo.setChaYiRemark20(statisVo.getChaYiRemark());
                }
            }
            collectVoList.add(collectVo);
        }

        //移除或过滤供应商中存在而标底中不存在的数据
        List<XfgcComprehensiveUnitPriceCollectVo> filteredList = collectVoList.stream()
                .filter(vo -> !StringUtils.isEmpty(vo.getNameType1()) &&
                        !StringUtils.isEmpty(vo.getBiddingNameC()) &&
                        !StringUtils.isEmpty(vo.getName()) &&
                        !StringUtils.isEmpty(vo.getCodeNumber()))
                .collect(Collectors.toList());
//        //按getNameType1分组
//        Map<String, List<XfgcComprehensiveUnitPriceCollectVo>> nameType1List = filteredList.stream()
//                .collect(Collectors.collectingAndThen(
//                        Collectors.groupingBy(vo -> Optional.ofNullable(vo.getNameType1()).orElse("null")),
//                        map -> {
//                            // 将"null"键替换为实际的null，以保持原始的Map结构
//                            List<XfgcComprehensiveUnitPriceCollectVo> nullList = map.remove("null");
//                            if (nullList != null) {
//                                map.put(null, nullList);
//                            }
//                            return map;
//                        }
//                ));
        // 按NameType1属性分组
        Map<String, List<XfgcComprehensiveUnitPriceCollectVo>> nameType1List = filteredList.stream()
                .collect(Collectors.groupingBy(XfgcComprehensiveUnitPriceCollectVo::getNameType1));
        //小项合计
        List<XfgcComprehensiveUnitPriceCollectVo> mapList = new ArrayList<>();
        for (Map.Entry<String, List<XfgcComprehensiveUnitPriceCollectVo>> item : nameType1List.entrySet()) {
            String nameType1 = item.getKey();
            List<XfgcComprehensiveUnitPriceCollectVo> value = item.getValue();

            XfgcComprehensiveUnitPriceCollectVo newT = calculationSubtotal(value);
            value.add(0, newT);
            mapList.addAll(value);
        }
        return mapList;
    }


    /**
     * 综合单价对比分析(单个供应商)
     *
     * @param toList
     * @param supplyCompany
     * @return
     */
    public List<XfgcComprehensiveUnitPriceCollectVo> getComprehensiveUnitPriceOne(List<XfgcComprehensiveUnitPriceCollectVo> toList, SupplyCompany supplyCompany, List<XfgcBiddingCompany> companyItemList, Integer jieDuan) {
        if (companyItemList.size() >= 1) {
            List<XfgcTabulation> tabulationList = xfgcTabulationService.getRepository().findByFlagAndXfgcBiddingCompanyIdAndJieDuan(1, companyItemList.get(0).getId(), jieDuan);
            if (tabulationList.size() == 0) {
                for (XfgcComprehensiveUnitPriceCollectVo vo : toList) {
                    vo.setBiddingNameC1(null);
                    vo.setBiddingNameC2(null);
                    vo.setBiddingNameC3(null);
                    vo.setBiddingNameC4(null);
                    vo.setBiddingNameC5(null);
                    vo.setBiddingNameC6(null);
                    vo.setBiddingNameC7(null);
                    vo.setBiddingNameC8(null);
                    vo.setBiddingNameC9(null);
                    vo.setBiddingNameC10(null);
                    vo.setBiddingNameC11(null);
                    vo.setBiddingNameC12(null);
                    vo.setBiddingNameC13(null);
                    vo.setBiddingNameC14(null);
                    vo.setBiddingNameC15(null);
                    vo.setBiddingNameC16(null);
                    vo.setBiddingNameC17(null);
                    vo.setBiddingNameC18(null);
                    vo.setBiddingNameC19(null);
                    vo.setBiddingNameC20(null);
                }
                return toList;
            }
        }
        for (XfgcComprehensiveUnitPriceCollectVo vo : toList) {
            if (supplyCompany.getName().equals(vo.getBiddingNameC1())) {
//                    vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC2())) {
                vo.setBiddingNameC1(null);
//                    vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC3())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
//                    vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC4())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
//                    vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC5())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
//                    vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC6())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
//                    vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC7())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
//                    vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC8())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
//                    vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC9())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
//                    vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC10())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
//                    vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC11())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
//                    vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC12())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
//                    vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC13())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
//                    vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC14())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
//                    vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC15())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
//                    vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC16())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
//                    vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC17())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
//                    vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC18())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
//                    vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC19())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
//                    vo.setBiddingNameC19(null);
                vo.setBiddingNameC20(null);
            }
            if (supplyCompany.getName().equals(vo.getBiddingNameC20())) {
                vo.setBiddingNameC1(null);
                vo.setBiddingNameC2(null);
                vo.setBiddingNameC3(null);
                vo.setBiddingNameC4(null);
                vo.setBiddingNameC5(null);
                vo.setBiddingNameC6(null);
                vo.setBiddingNameC7(null);
                vo.setBiddingNameC8(null);
                vo.setBiddingNameC9(null);
                vo.setBiddingNameC10(null);
                vo.setBiddingNameC11(null);
                vo.setBiddingNameC12(null);
                vo.setBiddingNameC13(null);
                vo.setBiddingNameC14(null);
                vo.setBiddingNameC15(null);
                vo.setBiddingNameC16(null);
                vo.setBiddingNameC17(null);
                vo.setBiddingNameC18(null);
                vo.setBiddingNameC19(null);
//                    vo.setBiddingNameC20(null);
            }
        }
        return toList;
    }


    /**
     * 分项总计
     *
     * @param collectVoList
     * @return
     */
    public XfgcComprehensiveUnitPriceCollectVo calculationSubtotal(List<XfgcComprehensiveUnitPriceCollectVo> collectVoList) {
        XfgcComprehensiveUnitPriceCollectVo newT = new XfgcComprehensiveUnitPriceCollectVo();
//        BigDecimal renGongCostCount = BigDecimal.ZERO;
//        BigDecimal zhuCaiCostCount = BigDecimal.ZERO;
//        BigDecimal fuCaiCostCount = BigDecimal.ZERO;
//        BigDecimal jiXieCostCount = BigDecimal.ZERO;
//        BigDecimal qiYeCostCount = BigDecimal.ZERO;
//        BigDecimal shuiJinCount = BigDecimal.ZERO;
        BigDecimal totalPrice = BigDecimal.ZERO;
        BigDecimal totalPrice1 = BigDecimal.ZERO;
        BigDecimal totalPrice2 = BigDecimal.ZERO;
        BigDecimal totalPrice3 = BigDecimal.ZERO;
        BigDecimal totalPrice4 = BigDecimal.ZERO;
        BigDecimal totalPrice5 = BigDecimal.ZERO;
        BigDecimal totalPrice6 = BigDecimal.ZERO;
        BigDecimal totalPrice7 = BigDecimal.ZERO;
        BigDecimal totalPrice8 = BigDecimal.ZERO;
        BigDecimal totalPrice9 = BigDecimal.ZERO;
        BigDecimal totalPrice10 = BigDecimal.ZERO;
        BigDecimal totalPrice11 = BigDecimal.ZERO;
        BigDecimal totalPrice12 = BigDecimal.ZERO;
        BigDecimal totalPrice13 = BigDecimal.ZERO;
        BigDecimal totalPrice14 = BigDecimal.ZERO;
        BigDecimal totalPrice15 = BigDecimal.ZERO;
        BigDecimal totalPrice16 = BigDecimal.ZERO;
        BigDecimal totalPrice17 = BigDecimal.ZERO;
        BigDecimal totalPrice18 = BigDecimal.ZERO;
        BigDecimal totalPrice19 = BigDecimal.ZERO;
        BigDecimal totalPrice20 = BigDecimal.ZERO;

        for (XfgcComprehensiveUnitPriceCollectVo tabulation : collectVoList) {
//            BigDecimal gongChengLiang = tabulation.getGongChengLiang() != null ? BigDecimal.valueOf(tabulation.getGongChengLiang()) : BigDecimal.ZERO;
//            BigDecimal renGongCost = tabulation.getRenGongCost() != null ? tabulation.getRenGongCost() : BigDecimal.ZERO;
//            BigDecimal zhuCaiCost = tabulation.getZhuCaiCost() != null ? tabulation.getZhuCaiCost() : BigDecimal.ZERO;
//            BigDecimal fuCaiCost = tabulation.getFuCaiCost() != null ? tabulation.getFuCaiCost() : BigDecimal.ZERO;
//            BigDecimal jiXieCost = tabulation.getJiXieCost() != null ? tabulation.getJiXieCost() : BigDecimal.ZERO;
//            BigDecimal qiYeCost = tabulation.getQiYeCost() != null ? tabulation.getQiYeCost() : BigDecimal.ZERO;
//            BigDecimal shuiJin = tabulation.getShuiJin() != null ? tabulation.getShuiJin() : BigDecimal.ZERO;

//            renGongCostCount = renGongCostCount.add(gongChengLiang.multiply(renGongCost));
//            zhuCaiCostCount = zhuCaiCostCount.add(gongChengLiang.multiply(zhuCaiCost));
//            fuCaiCostCount = fuCaiCostCount.add(gongChengLiang.multiply(fuCaiCost));
//            jiXieCostCount = jiXieCostCount.add(gongChengLiang.multiply(jiXieCost));
//            qiYeCostCount = qiYeCostCount.add(gongChengLiang.multiply(qiYeCost));
//            shuiJinCount = shuiJinCount.add(gongChengLiang.multiply(shuiJin));
            totalPrice = totalPrice.add(tabulation.getTotalPrice() != null ? tabulation.getTotalPrice() : BigDecimal.ZERO);
            totalPrice1 = totalPrice1.add(tabulation.getCalculateTotalPrice1() != null ? tabulation.getCalculateTotalPrice1() : BigDecimal.ZERO);
            totalPrice2 = totalPrice2.add(tabulation.getCalculateTotalPrice2() != null ? tabulation.getCalculateTotalPrice2() : BigDecimal.ZERO);
            totalPrice3 = totalPrice3.add(tabulation.getCalculateTotalPrice3() != null ? tabulation.getCalculateTotalPrice3() : BigDecimal.ZERO);
            totalPrice4 = totalPrice4.add(tabulation.getCalculateTotalPrice4() != null ? tabulation.getCalculateTotalPrice4() : BigDecimal.ZERO);
            totalPrice5 = totalPrice5.add(tabulation.getCalculateTotalPrice5() != null ? tabulation.getCalculateTotalPrice5() : BigDecimal.ZERO);
            totalPrice6 = totalPrice6.add(tabulation.getCalculateTotalPrice6() != null ? tabulation.getCalculateTotalPrice6() : BigDecimal.ZERO);
            totalPrice7 = totalPrice7.add(tabulation.getCalculateTotalPrice7() != null ? tabulation.getCalculateTotalPrice7() : BigDecimal.ZERO);
            totalPrice8 = totalPrice8.add(tabulation.getCalculateTotalPrice8() != null ? tabulation.getCalculateTotalPrice8() : BigDecimal.ZERO);
            totalPrice9 = totalPrice9.add(tabulation.getCalculateTotalPrice9() != null ? tabulation.getCalculateTotalPrice9() : BigDecimal.ZERO);
            totalPrice10 = totalPrice10.add(tabulation.getCalculateTotalPrice10() != null ? tabulation.getCalculateTotalPrice10() : BigDecimal.ZERO);
            totalPrice11 = totalPrice11.add(tabulation.getCalculateTotalPrice11() != null ? tabulation.getCalculateTotalPrice11() : BigDecimal.ZERO);
            totalPrice12 = totalPrice12.add(tabulation.getCalculateTotalPrice12() != null ? tabulation.getCalculateTotalPrice12() : BigDecimal.ZERO);
            totalPrice13 = totalPrice13.add(tabulation.getCalculateTotalPrice13() != null ? tabulation.getCalculateTotalPrice13() : BigDecimal.ZERO);
            totalPrice14 = totalPrice14.add(tabulation.getCalculateTotalPrice14() != null ? tabulation.getCalculateTotalPrice14() : BigDecimal.ZERO);
            totalPrice15 = totalPrice15.add(tabulation.getCalculateTotalPrice15() != null ? tabulation.getCalculateTotalPrice15() : BigDecimal.ZERO);
            totalPrice16 = totalPrice16.add(tabulation.getCalculateTotalPrice16() != null ? tabulation.getCalculateTotalPrice16() : BigDecimal.ZERO);
            totalPrice17 = totalPrice17.add(tabulation.getCalculateTotalPrice17() != null ? tabulation.getCalculateTotalPrice17() : BigDecimal.ZERO);
            totalPrice18 = totalPrice18.add(tabulation.getCalculateTotalPrice18() != null ? tabulation.getCalculateTotalPrice18() : BigDecimal.ZERO);
            totalPrice19 = totalPrice19.add(tabulation.getCalculateTotalPrice19() != null ? tabulation.getCalculateTotalPrice19() : BigDecimal.ZERO);
            totalPrice20 = totalPrice20.add(tabulation.getCalculateTotalPrice20() != null ? tabulation.getCalculateTotalPrice20() : BigDecimal.ZERO);

        }

        newT.setCodeNumber(collectVoList.get(0).getCodeNumberType());
        newT.setName(collectVoList.get(0).getNameType1());
//        newT.setRenGongCost(renGongCostCount);
//        newT.setZhuCaiCost(zhuCaiCostCount);
//        newT.setFuCaiCost(fuCaiCostCount);
//        newT.setJiXieCost(jiXieCostCount);
//        newT.setQiYeCost(qiYeCostCount);
//        newT.setShuiJin(shuiJinCount);
        newT.setTotalPrice(totalPrice);
        newT.setCalculateTotalPrice1(totalPrice1);
        newT.setCalculateTotalPrice2(totalPrice2);
        newT.setCalculateTotalPrice3(totalPrice3);
        newT.setCalculateTotalPrice4(totalPrice4);
        newT.setCalculateTotalPrice5(totalPrice5);
        newT.setCalculateTotalPrice6(totalPrice6);
        newT.setCalculateTotalPrice7(totalPrice7);
        newT.setCalculateTotalPrice8(totalPrice8);
        newT.setCalculateTotalPrice9(totalPrice9);
        newT.setCalculateTotalPrice10(totalPrice10);
        newT.setCalculateTotalPrice11(totalPrice11);
        newT.setCalculateTotalPrice12(totalPrice12);
        newT.setCalculateTotalPrice13(totalPrice13);
        newT.setCalculateTotalPrice14(totalPrice14);
        newT.setCalculateTotalPrice15(totalPrice15);
        newT.setCalculateTotalPrice16(totalPrice16);
        newT.setCalculateTotalPrice17(totalPrice17);
        newT.setCalculateTotalPrice18(totalPrice18);
        newT.setCalculateTotalPrice19(totalPrice19);
        newT.setCalculateTotalPrice20(totalPrice20);

        return newT;
    }


    /**
     * 排名
     *
     * @param extractingList
     * @param extracting
     * @param bd
     * @return
     */
    public StatisticalXfgcBiddingVo getPaiMing(List<XfgcTabulationExtractingVo> extractingList, XfgcTabulationExtractingVo extracting, XfgcTabulationExtractingVo bd, Integer tempType) throws InvocationTargetException, IllegalAccessException {
        BigDecimal bhsBaoJia = extracting.getBhsBaoJia() != null ? extracting.getBhsBaoJia() : BigDecimal.ZERO;
        BigDecimal bhszdcj = BigDecimal.ZERO;
        BigDecimal bhszdLv = BigDecimal.ZERO;
        BigDecimal bhsbdLv = BigDecimal.ZERO;
        BigDecimal chaYiLv = BigDecimal.ZERO;
        // 使用 Collections.sort() 对列表进行排序
        Collections.sort(extractingList, new Comparator<XfgcTabulationExtractingVo>() {
            @Override
            public int compare(XfgcTabulationExtractingVo o1, XfgcTabulationExtractingVo o2) {
                return o1.getHsBaoJia().compareTo(o2.getHsBaoJia());
            }
        });
        //找出本轮报价最低的那个供应商的数据
        BigDecimal bhsBaoJiaMin = BigDecimal.valueOf(Long.MAX_VALUE); // 初始化为最大值
        for (XfgcTabulationExtractingVo extracting2 : extractingList) {
            if (extracting2.getBhsBaoJia().compareTo(bhsBaoJiaMin) < 0) {
                bhsBaoJiaMin = extracting2.getBhsBaoJia();
            }
        }
        // 排名从 1 开始
        Integer paiMing = 1;
        for (XfgcTabulationExtractingVo temp : extractingList) {
            if (tempType == 1 || tempType == 3) {
                if (temp.getBhsBaoJia().compareTo(extracting.getBhsBaoJia()) >= 0) {
                    break;
                }
                paiMing++;
            }
            if (tempType == 2) {
                if (temp.getHsBaoJia().compareTo(extracting.getHsBaoJia()) >= 0) {
                    break;
                }
                paiMing++;
            }
        }
        //差异金额
        if (tempType == 3) {
            if (bhsBaoJiaMin != null && bhsBaoJiaMin.longValue() > 0) {
//                bhszdcj = bhsBaoJia.divide(bhsBaoJiaMin, 4, RoundingMode.HALF_UP);
                bhszdcj = bhsBaoJia.subtract(bhsBaoJiaMin);
            }
        } else {
            bhszdcj = bhsBaoJia.subtract(bhsBaoJiaMin);
        }
        if (bhsBaoJiaMin != null && bhsBaoJiaMin.compareTo(BigDecimal.ZERO) > 0) {
            bhszdLv = bhszdcj.divide(bhsBaoJiaMin, 4, RoundingMode.HALF_UP);
        }

        if (bd != null && bd.getBhsBaoJia().compareTo(BigDecimal.ZERO) > 0) {
            bhsbdLv = bhsBaoJia.subtract(bd.getBhsBaoJia()).divide(bd.getBhsBaoJia(), 4, RoundingMode.HALF_UP);
        }
        StatisticalXfgcBiddingVo tempVo = new StatisticalXfgcBiddingVo();
        tempVo.setSupplyCompany(extracting.getSupplyCompany());
        tempVo.setJieDuan(extracting.getJieDuan());
        tempVo.setShuiLv(extracting.getShuiLv());
        tempVo.setHsBaoJia(extracting.getHsBaoJia());
        tempVo.setBhsBaoJia(extracting.getBhsBaoJia());
//        tempVo.setHsxzBaoJia(extracting.getHsxzBaoJia());
        tempVo.setBhszdcj(bhszdcj);
        tempVo.setBhszdLv(bhszdLv);
        tempVo.setBhsbdLv(bhsbdLv);
        tempVo.setChaYiLv(chaYiLv);
        tempVo.setPaiMing(paiMing);

        return tempVo;
    }


    /**
     * 计算项目对应阶段的所有供应商清单提取信息
     *
     * @param projectId
     * @param jieDuan
     * @param tempType
     * @return
     */
    public List<XfgcTabulationExtractingVo> getAllXfgcTabulationExtracting(Long projectId, Integer jieDuan, Integer tempType) {
        HashMap hashMap = new HashMap();
        hashMap.put("xfgcBiddingCompany.project.id", projectId);
        hashMap.put("jieDuan", jieDuan);
        hashMap.put("flag", 1);
        List<XfgcTabulation> extractingList = xfgcTabulationService.getListLogic(hashMap, null);
        List<XfgcTabulationExtractingVo> itemList = new ArrayList<>();

        Map<Long, List<XfgcTabulation>> nameList = extractingList.stream().collect(Collectors.groupingBy(vo -> vo.getXfgcBiddingCompany().getId()));
        for (Map.Entry<Long, List<XfgcTabulation>> item : nameList.entrySet()) {
            List<XfgcTabulation> value = item.getValue();
            //供应商阶段数据准备
            List<XfgcTabulation> kzzjList = new ArrayList<>();
            List<XfgcTabulation> xfbfList = new ArrayList<>();
            XfgcTabulationExtractingVo kzzjVo = new XfgcTabulationExtractingVo();
            XfgcTabulationExtractingVo xfbfVo = new XfgcTabulationExtractingVo();
            BigDecimal hsBaoJiaZongHe = BigDecimal.ZERO; // 初始化为0
            BigDecimal bhsBaoJiaZongHe = BigDecimal.ZERO; // 初始化为0
            BigDecimal hsBaoJiaKzzj = BigDecimal.ZERO; // 初始化为0
            BigDecimal hsBaoJiaXfbf = BigDecimal.ZERO; // 初始化为0
            BigDecimal bhsBaoJiaKzzj = BigDecimal.ZERO; // 初始化为0
            BigDecimal bhsBaoJiaXfbf = BigDecimal.ZERO; // 初始化为0
            BigDecimal tempShuiLv = BigDecimal.ZERO;
            XfgcBiddingCompany xfgcBiddingCompany = new XfgcBiddingCompany();
            if (value.size() > 0) {
                tempShuiLv = value.get(0).getShuiJinFillIn();
                xfgcBiddingCompany = value.get(0).getXfgcBiddingCompany();
            }
            //分开标底抗震支架、消防部分数据
            for (XfgcTabulation vt : value) {
                if ("抗震支架系统".equals(vt.getNameType1()) && "KZZJ".equals(vt.getCodeNumberType())) {
                    hsBaoJiaKzzj = hsBaoJiaKzzj.add(vt.getTotalPriceHs());
                    kzzjList.add(vt);
                } else {
                    hsBaoJiaXfbf = hsBaoJiaXfbf.add(vt.getTotalPriceHs());
                    xfbfList.add(vt);
                }
            }
            //数据总计并转换
            hsBaoJiaZongHe = hsBaoJiaKzzj.add(hsBaoJiaXfbf);
            bhsBaoJiaZongHe = hsBaoJiaZongHe.divide(tempShuiLv.add(BigDecimal.ONE), 4, RoundingMode.HALF_UP);
            bhsBaoJiaKzzj = hsBaoJiaKzzj.divide(tempShuiLv.add(BigDecimal.ONE), 4, RoundingMode.HALF_UP);
            bhsBaoJiaXfbf = hsBaoJiaXfbf.divide(tempShuiLv.add(BigDecimal.ONE), 4, RoundingMode.HALF_UP);
            if (kzzjList.size() > 0) {
                kzzjVo.setProject(xfgcBiddingCompany.getProject());
                kzzjVo.setJieDuan(jieDuan);
                kzzjVo.setHsBaoJia(hsBaoJiaKzzj);
                kzzjVo.setBhsBaoJia(bhsBaoJiaKzzj);
                kzzjVo.setShuiLv(tempShuiLv);
                kzzjVo.setXfgcBiddingCompany(xfgcBiddingCompany);
            }
            if (xfbfList.size() > 0) {
                xfbfVo.setProject(xfgcBiddingCompany.getProject());
                xfbfVo.setJieDuan(jieDuan);
                xfbfVo.setHsBaoJia(hsBaoJiaXfbf);
                xfbfVo.setBhsBaoJia(bhsBaoJiaXfbf);
                xfbfVo.setShuiLv(tempShuiLv);
                xfbfVo.setXfgcBiddingCompany(xfgcBiddingCompany);
            }
            if (tempType == 1) {
                itemList.add(kzzjVo);
            }
            if (tempType == 2) {
                itemList.add(xfbfVo);
            }
            if (tempType == 3) {
                XfgcTabulationExtractingVo tempVo = new XfgcTabulationExtractingVo();
                tempVo.setProject(xfgcBiddingCompany.getProject());
                tempVo.setJieDuan(jieDuan);
                tempVo.setHsBaoJia(hsBaoJiaZongHe);
                tempVo.setBhsBaoJia(bhsBaoJiaZongHe);
                tempVo.setShuiLv(tempShuiLv);
                tempVo.setXfgcBiddingCompany(xfgcBiddingCompany);
                itemList.add(tempVo);
            }
        }
        return itemList;
    }

    /**
     * 创建单元格
     *
     * @param row
     * @param index
     * @param style
     * @return
     */
    public static Cell createCellAddStype(Row row, Integer index, CellStyle style) {
        Cell hssfCell = row.createCell(index);
        hssfCell.setCellStyle(style);
        return hssfCell;
    }

    /**
     * 导出综合单价对比分析
     *
     * @param sortedList
     * @return
     */
    public XSSFWorkbook exportZhdj(List<XfgcComprehensiveUnitPriceCollectVo> sortedList) {
        XSSFWorkbook workbook = new XSSFWorkbook();
        Sheet sheet = workbook.createSheet("综合单价横向对比表");
        CellStyle cellStyle = workbook.createCellStyle();
        cellStyle.setAlignment(HorizontalAlignment.CENTER); // 居中
        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); // 居中
        // 创建日期格式
        CellStyle cellDateStyle = workbook.createCellStyle();
        CreationHelper createHelper = workbook.getCreationHelper();
        cellDateStyle.setDataFormat(createHelper.createDataFormat().getFormat("yyyy-mm-dd hh:mm:ss"));
//        Row row0 = sheet.createRow(0);
//        createCellAddStype(row0, 0, cellStyle).setCellValue("工程量清单综合单价计价表");
//        CellRangeAddress titleRegion = new CellRangeAddress(0, 0, 0, 20);// 下标从0开始 起始行号，终止行号， 起始列号，终
//        sheet.addMergedRegionUnsafe(titleRegion);
        //边框
        cellStyle.setBorderBottom(BorderStyle.THIN); //下边框
        cellStyle.setBorderLeft(BorderStyle.THIN);//左边框
        cellStyle.setBorderTop(BorderStyle.THIN);//上边框
        cellStyle.setBorderRight(BorderStyle.THIN);//右边框
        cellDateStyle.setBorderBottom(BorderStyle.THIN); //下边框
        cellDateStyle.setBorderLeft(BorderStyle.THIN);//左边框
        cellDateStyle.setBorderTop(BorderStyle.THIN);//上边框
        cellDateStyle.setBorderRight(BorderStyle.THIN);//右边框

        if (sortedList.size() > 0) {
            Row row1 = sheet.createRow(0);
            createCellAddStype(row1, 0, cellStyle).setCellValue("工程量清单综合单价计价表");
            createCellAddStype(row1, 1, cellStyle).setCellValue("工程量清单综合单价计价表");
            createCellAddStype(row1, 2, cellStyle).setCellValue("工程量清单综合单价计价表");
            createCellAddStype(row1, 3, cellStyle).setCellValue("工程量清单综合单价计价表");
            createCellAddStype(row1, 4, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC());
            createCellAddStype(row1, 5, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC());
            createCellAddStype(row1, 6, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC());
            createCellAddStype(row1, 7, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC());
            createCellAddStype(row1, 8, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC());
            createCellAddStype(row1, 9, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC());
            createCellAddStype(row1, 10, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC());
            int indexA = 11;
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC1())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC1());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC2())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC2());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC3())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC3());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC4())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC4());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC5())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC5());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC6())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC6());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC7())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC7());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC8())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC8());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC9())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC9());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC10())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC10());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC11())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC11());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC12())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC12());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC13())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC13());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC14())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC14());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC15())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC15());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC16())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC16());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC17())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC17());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC18())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC18());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC19())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC19());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC20())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(1).getBiddingNameC20());
            }
        }

        Row row2 = sheet.createRow(1);
        createCellAddStype(row2, 0, cellStyle).setCellValue("序号");
        createCellAddStype(row2, 1, cellStyle).setCellValue("名称");
        createCellAddStype(row2, 2, cellStyle).setCellValue("项目特征及主要工程内容");
        createCellAddStype(row2, 3, cellStyle).setCellValue("单位");
        createCellAddStype(row2, 4, cellStyle).setCellValue("工程量");
        createCellAddStype(row2, 5, cellStyle).setCellValue("含税综合单价");
        createCellAddStype(row2, 6, cellStyle).setCellValue("含税合价");
        createCellAddStype(row2, 7, cellStyle).setCellValue("人工费");
        createCellAddStype(row2, 8, cellStyle).setCellValue("主材费");
        createCellAddStype(row2, 9, cellStyle).setCellValue("机械费");
        createCellAddStype(row2, 10, cellStyle).setCellValue("企业管理费");
        int indexB = 11;
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC1())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");

        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC2())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC3())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC4())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC5())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC6())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC7())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC8())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC9())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC10())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC11())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC12())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC13())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC14())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC15())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC16())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC17())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC18())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC19())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC20())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("投标含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("主材费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("企业管理费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税综合单价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("计算含税合价");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较标底偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("较本轮回标最低价偏离百分比");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("备注差异");
        }
        CellRangeAddress cra1 = new CellRangeAddress(0, 0, 0, 3);
        CellRangeAddress cra2 = new CellRangeAddress(0, 0, 4, 10);
        CellRangeAddress cra3 = new CellRangeAddress(0, 0, 11, 21);
        CellRangeAddress cra4 = new CellRangeAddress(0, 0, 22, 32);
        CellRangeAddress cra5 = new CellRangeAddress(0, 0, 33, 43);
        CellRangeAddress cra6 = new CellRangeAddress(0, 0, 44, 54);
        CellRangeAddress cra7 = new CellRangeAddress(0, 0, 55, 65);
        CellRangeAddress cra8 = new CellRangeAddress(0, 0, 66, 76);
        CellRangeAddress cra9 = new CellRangeAddress(0, 0, 77, 87);
        CellRangeAddress cra10 = new CellRangeAddress(0, 0, 88, 98);
        CellRangeAddress cra11 = new CellRangeAddress(0, 0, 99, 109);
        CellRangeAddress cra12 = new CellRangeAddress(0, 0, 110, 120);
        CellRangeAddress cra13 = new CellRangeAddress(0, 0, 121, 131);
        CellRangeAddress cra14 = new CellRangeAddress(0, 0, 132, 142);
        CellRangeAddress cra15 = new CellRangeAddress(0, 0, 143, 153);
        CellRangeAddress cra16 = new CellRangeAddress(0, 0, 154, 164);
        CellRangeAddress cra17 = new CellRangeAddress(0, 0, 165, 175);
        CellRangeAddress cra18 = new CellRangeAddress(0, 0, 176, 186);
        CellRangeAddress cra19 = new CellRangeAddress(0, 0, 187, 197);
        CellRangeAddress cra20 = new CellRangeAddress(0, 0, 198, 208);
        CellRangeAddress cra21 = new CellRangeAddress(0, 0, 209, 219);
        CellRangeAddress cra22 = new CellRangeAddress(0, 0, 220, 230);
//        CellRangeAddress cra23 = new CellRangeAddress(0, 0, 127, 132);
//        CellRangeAddress cra24 = new CellRangeAddress(0, 0, 133, 138);
//        CellRangeAddress cra25 = new CellRangeAddress(0, 0, 139, 144);
//        CellRangeAddress cra26 = new CellRangeAddress(0, 0, 145, 150);
//        CellRangeAddress cra27 = new CellRangeAddress(0, 0, 151, 156);

        //在sheet里增加合并单元格
        sheet.addMergedRegion(cra1);
        sheet.addMergedRegion(cra2);
        sheet.addMergedRegion(cra3);
        sheet.addMergedRegion(cra4);
        sheet.addMergedRegion(cra5);
        sheet.addMergedRegion(cra6);
        sheet.addMergedRegion(cra7);
        sheet.addMergedRegion(cra8);
        sheet.addMergedRegion(cra9);
        sheet.addMergedRegion(cra10);
        sheet.addMergedRegion(cra11);
        sheet.addMergedRegion(cra12);
        sheet.addMergedRegion(cra13);
        sheet.addMergedRegion(cra14);
        sheet.addMergedRegion(cra15);
        sheet.addMergedRegion(cra16);
        sheet.addMergedRegion(cra17);
        sheet.addMergedRegion(cra18);
        sheet.addMergedRegion(cra19);
        sheet.addMergedRegion(cra20);
        sheet.addMergedRegion(cra21);
        sheet.addMergedRegion(cra22);
//        sheet.addMergedRegion(cra23);
//        sheet.addMergedRegion(cra24);
//        sheet.addMergedRegion(cra25);
//        sheet.addMergedRegion(cra26);
//        sheet.addMergedRegion(cra27);

        Integer rowIndex = 2;
        for (XfgcComprehensiveUnitPriceCollectVo item : sortedList) {
            Row row = sheet.createRow(rowIndex);
            createCellAddStype(row, 0, cellStyle).setCellValue(item.getCodeNumber());
            createCellAddStype(row, 1, cellStyle).setCellValue(item.getName());
            createCellAddStype(row, 2, cellStyle).setCellValue(item.getTeZhengNeiRong());
            createCellAddStype(row, 3, cellStyle).setCellValue(item.getUnit());
            createCellAddStype(row, 4, cellStyle).setCellValue(item.getGongChengLiang() != null ? item.getGongChengLiang().toString() : "");
            createCellAddStype(row, 5, cellStyle).setCellValue(item.getComprehensivePrice() != null ? item.getComprehensivePrice().toString() : "0");
            createCellAddStype(row, 6, cellStyle).setCellValue(item.getTotalPrice() != null ? item.getTotalPrice().toString() : "0");
            createCellAddStype(row, 7, cellStyle).setCellValue(item.getRenGongCost() != null ? item.getRenGongCost().toString() : "0");
            createCellAddStype(row, 8, cellStyle).setCellValue(item.getZhuCaiCost() != null ? item.getZhuCaiCost().toString() : "0");
            createCellAddStype(row, 9, cellStyle).setCellValue(item.getJiXieCost() != null ? item.getJiXieCost().toString() : "0");
            createCellAddStype(row, 10, cellStyle).setCellValue(item.getQiYeCost() != null ? item.getQiYeCost().toString() : "0");
            int indexC = 11;
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC1())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice1() != null ? item.getComprehensivePrice1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice1() != null ? item.getTotalPrice1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost1() != null ? item.getRenGongCost1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost1() != null ? item.getZhuCaiCost1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost1() != null ? item.getJiXieCost1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost1() != null ? item.getQiYeCost1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs1() != null ? item.getCalculateComprehensivePriceHs1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice1() != null ? item.getCalculateTotalPrice1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi1() != null ? item.getBiaoDi1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao1() != null ? item.getHuiBiao1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark1());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC2())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice2() != null ? item.getComprehensivePrice2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice2() != null ? item.getTotalPrice2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost2() != null ? item.getRenGongCost2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost2() != null ? item.getZhuCaiCost2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost2() != null ? item.getJiXieCost2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost2() != null ? item.getQiYeCost2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs2() != null ? item.getCalculateComprehensivePriceHs2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice2() != null ? item.getCalculateTotalPrice2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi2() != null ? item.getBiaoDi2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao2() != null ? item.getHuiBiao2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark2());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC3())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice3() != null ? item.getComprehensivePrice3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice3() != null ? item.getTotalPrice3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost3() != null ? item.getRenGongCost3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost3() != null ? item.getZhuCaiCost3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost3() != null ? item.getJiXieCost3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost3() != null ? item.getQiYeCost3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs3() != null ? item.getCalculateComprehensivePriceHs3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice3() != null ? item.getCalculateTotalPrice3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi3() != null ? item.getBiaoDi3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao3() != null ? item.getHuiBiao3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark3());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC4())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice4() != null ? item.getComprehensivePrice4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice4() != null ? item.getTotalPrice4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost4() != null ? item.getRenGongCost4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost4() != null ? item.getZhuCaiCost4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost4() != null ? item.getJiXieCost4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost4() != null ? item.getQiYeCost4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs4() != null ? item.getCalculateComprehensivePriceHs4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice4() != null ? item.getCalculateTotalPrice4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi4() != null ? item.getBiaoDi4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao4() != null ? item.getHuiBiao4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark4());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC5())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice5() != null ? item.getComprehensivePrice5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice5() != null ? item.getTotalPrice5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost5() != null ? item.getRenGongCost5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost5() != null ? item.getZhuCaiCost5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost5() != null ? item.getJiXieCost5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost5() != null ? item.getQiYeCost5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs5() != null ? item.getCalculateComprehensivePriceHs5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice5() != null ? item.getCalculateTotalPrice5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi5() != null ? item.getBiaoDi5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao5() != null ? item.getHuiBiao5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark5());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC6())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice6() != null ? item.getComprehensivePrice6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice6() != null ? item.getTotalPrice6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost6() != null ? item.getRenGongCost6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost6() != null ? item.getZhuCaiCost6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost6() != null ? item.getJiXieCost6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost6() != null ? item.getQiYeCost6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs6() != null ? item.getCalculateComprehensivePriceHs6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice6() != null ? item.getCalculateTotalPrice6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi6() != null ? item.getBiaoDi6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao6() != null ? item.getHuiBiao6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark6());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC7())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice7() != null ? item.getComprehensivePrice7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice7() != null ? item.getTotalPrice7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost7() != null ? item.getRenGongCost7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost7() != null ? item.getZhuCaiCost7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost7() != null ? item.getJiXieCost7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost7() != null ? item.getQiYeCost7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs7() != null ? item.getCalculateComprehensivePriceHs7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice7() != null ? item.getCalculateTotalPrice7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi7() != null ? item.getBiaoDi7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao7() != null ? item.getHuiBiao7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark7());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC8())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice8() != null ? item.getComprehensivePrice8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice8() != null ? item.getTotalPrice8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost8() != null ? item.getRenGongCost8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost8() != null ? item.getZhuCaiCost8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost8() != null ? item.getJiXieCost8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost8() != null ? item.getQiYeCost8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs8() != null ? item.getCalculateComprehensivePriceHs8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice8() != null ? item.getCalculateTotalPrice8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi8() != null ? item.getBiaoDi8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao8() != null ? item.getHuiBiao8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark8());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC9())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice9() != null ? item.getComprehensivePrice9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice9() != null ? item.getTotalPrice9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost9() != null ? item.getRenGongCost9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost9() != null ? item.getZhuCaiCost9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost9() != null ? item.getJiXieCost9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost9() != null ? item.getQiYeCost9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs9() != null ? item.getCalculateComprehensivePriceHs9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice9() != null ? item.getCalculateTotalPrice9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi9() != null ? item.getBiaoDi9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao9() != null ? item.getHuiBiao9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark9());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC10())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice10() != null ? item.getComprehensivePrice10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice10() != null ? item.getTotalPrice10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost10() != null ? item.getRenGongCost10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost10() != null ? item.getZhuCaiCost10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost10() != null ? item.getJiXieCost10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost10() != null ? item.getQiYeCost10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs10() != null ? item.getCalculateComprehensivePriceHs10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice10() != null ? item.getCalculateTotalPrice10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi10() != null ? item.getBiaoDi10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao10() != null ? item.getHuiBiao10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark10());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC11())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice11() != null ? item.getComprehensivePrice11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice11() != null ? item.getTotalPrice11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost11() != null ? item.getRenGongCost11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost11() != null ? item.getZhuCaiCost11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost11() != null ? item.getJiXieCost11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost11() != null ? item.getQiYeCost11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs11() != null ? item.getCalculateComprehensivePriceHs11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice11() != null ? item.getCalculateTotalPrice11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi11() != null ? item.getBiaoDi11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao11() != null ? item.getHuiBiao11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark11());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC12())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice12() != null ? item.getComprehensivePrice12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice12() != null ? item.getTotalPrice12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost12() != null ? item.getRenGongCost12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost12() != null ? item.getZhuCaiCost12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost12() != null ? item.getJiXieCost12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost12() != null ? item.getQiYeCost12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs12() != null ? item.getCalculateComprehensivePriceHs12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice12() != null ? item.getCalculateTotalPrice12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi12() != null ? item.getBiaoDi12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao12() != null ? item.getHuiBiao12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark12());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC13())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice13() != null ? item.getComprehensivePrice13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice13() != null ? item.getTotalPrice13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost13() != null ? item.getRenGongCost13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost13() != null ? item.getZhuCaiCost13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost13() != null ? item.getJiXieCost13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost13() != null ? item.getQiYeCost13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs13() != null ? item.getCalculateComprehensivePriceHs13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice13() != null ? item.getCalculateTotalPrice13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi13() != null ? item.getBiaoDi13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao13() != null ? item.getHuiBiao13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark13());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC14())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice14() != null ? item.getComprehensivePrice14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice14() != null ? item.getTotalPrice14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost14() != null ? item.getRenGongCost14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost14() != null ? item.getZhuCaiCost14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost14() != null ? item.getJiXieCost14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost14() != null ? item.getQiYeCost14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs14() != null ? item.getCalculateComprehensivePriceHs14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice14() != null ? item.getCalculateTotalPrice14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi14() != null ? item.getBiaoDi14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao14() != null ? item.getHuiBiao14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark14());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC15())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice15() != null ? item.getComprehensivePrice15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice15() != null ? item.getTotalPrice15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost15() != null ? item.getRenGongCost15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost15() != null ? item.getZhuCaiCost15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost15() != null ? item.getJiXieCost15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost15() != null ? item.getQiYeCost15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs15() != null ? item.getCalculateComprehensivePriceHs15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice15() != null ? item.getCalculateTotalPrice15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi15() != null ? item.getBiaoDi15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao15() != null ? item.getHuiBiao15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark15());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC16())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice16() != null ? item.getComprehensivePrice16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice16() != null ? item.getTotalPrice16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost16() != null ? item.getRenGongCost16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost16() != null ? item.getZhuCaiCost16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost16() != null ? item.getJiXieCost16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost16() != null ? item.getQiYeCost16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs16() != null ? item.getCalculateComprehensivePriceHs16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice16() != null ? item.getCalculateTotalPrice16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi16() != null ? item.getBiaoDi16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao16() != null ? item.getHuiBiao16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark16());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC17())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice17() != null ? item.getComprehensivePrice17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice17() != null ? item.getTotalPrice17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost17() != null ? item.getRenGongCost17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost17() != null ? item.getZhuCaiCost17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost17() != null ? item.getJiXieCost17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost17() != null ? item.getQiYeCost17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs17() != null ? item.getCalculateComprehensivePriceHs17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice17() != null ? item.getCalculateTotalPrice17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi17() != null ? item.getBiaoDi17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao17() != null ? item.getHuiBiao17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark17());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC18())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice18() != null ? item.getComprehensivePrice18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice18() != null ? item.getTotalPrice18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost18() != null ? item.getRenGongCost18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost18() != null ? item.getZhuCaiCost18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost18() != null ? item.getJiXieCost18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost18() != null ? item.getQiYeCost18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs18() != null ? item.getCalculateComprehensivePriceHs18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice18() != null ? item.getCalculateTotalPrice18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi18() != null ? item.getBiaoDi18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao18() != null ? item.getHuiBiao18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark18());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC19())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice19() != null ? item.getComprehensivePrice19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice19() != null ? item.getTotalPrice19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost19() != null ? item.getRenGongCost19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost19() != null ? item.getZhuCaiCost19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost19() != null ? item.getJiXieCost19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost19() != null ? item.getQiYeCost19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs19() != null ? item.getCalculateComprehensivePriceHs19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice19() != null ? item.getCalculateTotalPrice19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi19() != null ? item.getBiaoDi19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao19() != null ? item.getHuiBiao19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark19());
            }
            if (StringUtils.isNotEmpty(sortedList.get(1).getBiddingNameC20())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getComprehensivePrice20() != null ? item.getComprehensivePrice20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getTotalPrice20() != null ? item.getTotalPrice20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost20() != null ? item.getRenGongCost20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getZhuCaiCost20() != null ? item.getZhuCaiCost20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost20() != null ? item.getJiXieCost20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getQiYeCost20() != null ? item.getQiYeCost20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateComprehensivePriceHs20() != null ? item.getCalculateComprehensivePriceHs20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getCalculateTotalPrice20() != null ? item.getCalculateTotalPrice20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBiaoDi20() != null ? item.getBiaoDi20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getHuiBiao20() != null ? item.getHuiBiao20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getChaYiRemark20());
            }
            rowIndex++;
        }

        return workbook;
    }


    /**
     * 计算综合单价对比中供应商的‘含税综合单价’、‘含税合价’
     *
     * @param tabulation
     * @return
     */
    public CalculateXfgcPriceVo calculatePrice(XfgcTabulation tabulation) {
        BigDecimal calculateComprehensivePriceHs = BigDecimal.ZERO;
        BigDecimal calculateTotalPriceHs = BigDecimal.ZERO;

        BigDecimal renGongCost = tabulation.getRenGongCost() != null ? tabulation.getRenGongCost() : BigDecimal.ZERO;
        BigDecimal zhuCaiCost = tabulation.getZhuCaiCost() != null ? tabulation.getZhuCaiCost() : BigDecimal.ZERO;
        BigDecimal fuCaiCost = tabulation.getFuCaiCost() != null ? tabulation.getFuCaiCost() : BigDecimal.ZERO;
        BigDecimal jiXieCost = tabulation.getJiXieCost() != null ? tabulation.getJiXieCost() : BigDecimal.ZERO;
        BigDecimal gongChengLiangHuiZong = tabulation.getGongChengLiangHuiZong() != null ? tabulation.getGongChengLiangHuiZong() : BigDecimal.ZERO;

        BigDecimal qiYeCostFillIn = tabulation.getQiYeCostFillIn() != null ? tabulation.getQiYeCostFillIn() : BigDecimal.ZERO;
        BigDecimal shuiJinFillIn = tabulation.getShuiJinFillIn() != null ? tabulation.getShuiJinFillIn() : BigDecimal.ZERO;
        // 计算‘含税综合单价’、‘含税合价’
        calculateComprehensivePriceHs = renGongCost.add(zhuCaiCost).add(fuCaiCost).add(jiXieCost).multiply(BigDecimal.ONE.add(qiYeCostFillIn)).multiply(BigDecimal.ONE.add(shuiJinFillIn));
        calculateTotalPriceHs = calculateComprehensivePriceHs.multiply(gongChengLiangHuiZong);
        //返回值
        CalculateXfgcPriceVo priceVo = new CalculateXfgcPriceVo();
        priceVo.setCalculateComprehensivePriceHs(calculateComprehensivePriceHs);
        priceVo.setCalculateTotalPriceHs(calculateTotalPriceHs);
        return priceVo;
    }


    /**
     * 消防-投标报价横向对比
     *
     * @param companyList
     * @param projectId
     * @param jieDuan
     * @return
     */
    public List<XfgcComparisonOfClassificationCollectVo> getComparisonOfClassification(List<XfgcBiddingCompany> companyList, Long projectId, Integer jieDuan) {
        List<XfgcBidBaseTabulation> innerBidBaseTabulationList = xfgcBidBaseTabulationService.getRepository().findByFlagAndProjectId(1, projectId);
        List<XfgcComparisonOfClassificationVo> bdVoList = new ArrayList<>();
        // 对比分析时所需分析分类(分析分类2)
        //计算标底所需数据
        Map<String, List<XfgcBidBaseTabulation>> fenLeiList = innerBidBaseTabulationList.stream().collect(Collectors.groupingBy(XfgcBidBaseTabulation::getFenXiFenLei2));
        for (Map.Entry<String, List<XfgcBidBaseTabulation>> item : fenLeiList.entrySet()) {
            String fenXiFenLei = item.getKey();
            List<XfgcBidBaseTabulation> value = item.getValue();
            XfgcComparisonOfClassificationVo bdVo = new XfgcComparisonOfClassificationVo();
            BigDecimal gongChengLiangCount = BigDecimal.ZERO;
            BigDecimal renGongCostCount = BigDecimal.ZERO;
            BigDecimal fuCaiCostCount = BigDecimal.ZERO;
            BigDecimal jiXieCostCount = BigDecimal.ZERO;
            BigDecimal bhsCount = BigDecimal.ZERO;
            BigDecimal dianWeiDanFang = BigDecimal.ZERO;
            for (XfgcBidBaseTabulation tabulation : value) {
                if (tabulation.getGongChengLiangHuiZong() != null) {
                    gongChengLiangCount = gongChengLiangCount.add(tabulation.getGongChengLiangHuiZong());
                }
                if (tabulation.getGongChengLiangHuiZong() != null && tabulation.getRenGongCost() != null) {
                    BigDecimal tempRenGongCost = tabulation.getGongChengLiangHuiZong().multiply(tabulation.getRenGongCost());
                    renGongCostCount = renGongCostCount.add(tempRenGongCost);
                }
                if (tabulation.getGongChengLiangHuiZong() != null && tabulation.getFuCaiCost() != null) {
                    BigDecimal tempFuCaiCost = tabulation.getGongChengLiangHuiZong().multiply(tabulation.getFuCaiCost());
                    fuCaiCostCount = fuCaiCostCount.add(tempFuCaiCost);
                }
                if (tabulation.getGongChengLiangHuiZong() != null && tabulation.getJiXieCost() != null) {
                    BigDecimal tempJiXieCost = tabulation.getGongChengLiangHuiZong().multiply(tabulation.getJiXieCost());
                    jiXieCostCount = jiXieCostCount.add(tempJiXieCost);
                }
            }
            bhsCount = renGongCostCount.add(fuCaiCostCount).add(jiXieCostCount);
            if (gongChengLiangCount != null && gongChengLiangCount.compareTo(BigDecimal.ZERO) != 0) {
                dianWeiDanFang = bhsCount.divide(gongChengLiangCount,2, RoundingMode.HALF_UP);
            }
            bdVo.setSort(1);
            bdVo.setBiddingName("标底");
            bdVo.setFenXiFenLeiTwo(fenXiFenLei);
            bdVo.setGongChengLiang(gongChengLiangCount);
            bdVo.setRenGongCost(renGongCostCount);
            bdVo.setFuCaiCost(fuCaiCostCount);
            bdVo.setJiXieCost(jiXieCostCount);
            bdVo.setBhsCount(bhsCount);
            bdVo.setDianWeiDanFang(dianWeiDanFang);
            bdVoList.add(bdVo);
        }

        //计算供应商清单对应数据
        List<XfgcComparisonOfClassificationVo> gsVoList = new ArrayList<>();
        Integer sort = 1;
        for (XfgcBiddingCompany company : companyList) {
            List<XfgcTabulation> tabulationList = xfgcTabulationService.getRepository().findByFlagAndXfgcBiddingCompanyIdAndJieDuan(1, company.getId(), jieDuan);
            Map<String, List<XfgcTabulation>> fenLeiInList = tabulationList.stream().collect(Collectors.groupingBy(XfgcTabulation::getFenXiFenLei2));
            sort++;
            for (Map.Entry<String, List<XfgcTabulation>> item : fenLeiInList.entrySet()) {
                String fenXiFenLei = item.getKey();
                List<XfgcTabulation> value = item.getValue();
                XfgcComparisonOfClassificationVo gsVo = new XfgcComparisonOfClassificationVo();
                BigDecimal gongChengLiangCount = BigDecimal.ZERO;
                BigDecimal renGongCostCount = BigDecimal.ZERO;
                BigDecimal fuCaiCostCount = BigDecimal.ZERO;
                BigDecimal jiXieCostCount = BigDecimal.ZERO;
                BigDecimal bhsCount = BigDecimal.ZERO;
                BigDecimal dianWeiDanFang = BigDecimal.ZERO;
                for (XfgcTabulation tabulation : value) {
                    if (tabulation.getGongChengLiangHuiZong() != null) {
                        gongChengLiangCount = gongChengLiangCount.add(tabulation.getGongChengLiangHuiZong());
                    }
                    if (tabulation.getGongChengLiangHuiZong() != null && tabulation.getRenGongCost() != null) {
                        BigDecimal tempRenGongCost = tabulation.getGongChengLiangHuiZong().multiply(tabulation.getRenGongCost());
                        renGongCostCount = renGongCostCount.add(tempRenGongCost);
                    }
                    if (tabulation.getGongChengLiangHuiZong() != null && tabulation.getFuCaiCost() != null) {
                        BigDecimal tempFuCaiCost = tabulation.getGongChengLiangHuiZong().multiply(tabulation.getFuCaiCost());
                        fuCaiCostCount = fuCaiCostCount.add(tempFuCaiCost);
                    }
                    if (tabulation.getGongChengLiangHuiZong() != null && tabulation.getJiXieCost() != null) {
                        BigDecimal tempJiXieCost = tabulation.getGongChengLiangHuiZong().multiply(tabulation.getJiXieCost());
                        jiXieCostCount = jiXieCostCount.add(tempJiXieCost);
                    }
                }
                bhsCount = renGongCostCount.add(fuCaiCostCount).add(jiXieCostCount);
//                dianWeiDanFang = bhsCount.divide(gongChengLiangCount,2, RoundingMode.HALF_UP);
                gsVo.setSort(sort);
                gsVo.setBiddingName(company.getSupplyCompany().getName());
                gsVo.setFenXiFenLeiTwo(fenXiFenLei);
                gsVo.setGongChengLiang(gongChengLiangCount);
                gsVo.setRenGongCost(renGongCostCount);
                gsVo.setFuCaiCost(fuCaiCostCount);
                gsVo.setJiXieCost(jiXieCostCount);
                gsVo.setBhsCount(bhsCount);
//                gsVo.setDianWeiDanFang(dianWeiDanFang);
                gsVoList.add(gsVo);
            }
        }
        //数据合并及格式转换
        List<XfgcComparisonOfClassificationVo> valueTbList = new ArrayList<>();
        valueTbList.addAll(bdVoList);
        valueTbList.addAll(bdVoList.size(), gsVoList);

        List<XfgcComparisonOfClassificationCollectVo> collectVoList = new ArrayList<>();
        Map<String, List<XfgcComparisonOfClassificationVo>> tempMap = valueTbList.stream().collect(Collectors.groupingBy(XfgcComparisonOfClassificationVo::getFenXiFenLeiTwo));
        for (Map.Entry<String, List<XfgcComparisonOfClassificationVo>> item : tempMap.entrySet()) {
            String name = item.getKey();
            List<XfgcComparisonOfClassificationVo> value = item.getValue();
            XfgcComparisonOfClassificationCollectVo collectVo = new XfgcComparisonOfClassificationCollectVo();
            for (XfgcComparisonOfClassificationVo statisVo : value) {
                String xiTongFenLei = null;
                if ("电气配管".equals(statisVo.getFenXiFenLeiTwo()) || "电气配线".equals(statisVo.getFenXiFenLeiTwo())
                        || "电系统末端点位（烟感、模块、灯具等）".equals(statisVo.getFenXiFenLeiTwo()) || "电系统设备".equals(statisVo.getFenXiFenLeiTwo())) {
                    xiTongFenLei = "消防电系统";
                }
                if ("阀门阀件".equals(statisVo.getFenXiFenLeiTwo()) || "水系统管道".equals(statisVo.getFenXiFenLeiTwo())
                        || "水系统末端点位（接合器、消火栓、灭火器、喷淋头等）".equals(statisVo.getFenXiFenLeiTwo())
                        || "水系统设备（泵、稳压设备、泡沫罐等）".equals(statisVo.getFenXiFenLeiTwo()) || "水箱".equals(statisVo.getFenXiFenLeiTwo())
                        || "其他".equals(statisVo.getFenXiFenLeiTwo())) {
                    xiTongFenLei = "消防水系统";
                }
                if ("消防检测及验收".equals(statisVo.getFenXiFenLeiTwo())) {
                    xiTongFenLei = "消防检测及验收";
                }
                if ("质保期内维保".equals(statisVo.getFenXiFenLeiTwo())) {
                    xiTongFenLei = "质保期内维保";
                }
                if ("防火封堵".equals(statisVo.getFenXiFenLeiTwo())) {
                    xiTongFenLei = "防火封堵";
                }
                if ("抗震支架".equals(statisVo.getFenXiFenLeiTwo())) {
                    xiTongFenLei = "抗震支架";
                }
                collectVo.setXiTongFenLei(xiTongFenLei);
                if (statisVo.getSort() == 1) {
                    collectVo.setBiddingName("标底");
                    collectVo.setFenXiFenLeiTwo(statisVo.getFenXiFenLeiTwo());
                    collectVo.setGongChengLiang(statisVo.getGongChengLiang());
                    collectVo.setDianWeiDanFang(statisVo.getDianWeiDanFang());
                    collectVo.setRenGongCost(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost(statisVo.getJiXieCost());
                    collectVo.setBhsCount(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 2) {
                    collectVo.setBiddingName1(statisVo.getBiddingName());
                    collectVo.setGongChengLiang1(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost1(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost1(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost1(statisVo.getJiXieCost());
                    collectVo.setBhsCount1(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 3) {
                    collectVo.setBiddingName2(statisVo.getBiddingName());
                    collectVo.setGongChengLiang2(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost2(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost2(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost2(statisVo.getJiXieCost());
                    collectVo.setBhsCount2(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 4) {
                    collectVo.setBiddingName3(statisVo.getBiddingName());
                    collectVo.setGongChengLiang3(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost3(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost3(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost3(statisVo.getJiXieCost());
                    collectVo.setBhsCount3(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 5) {
                    collectVo.setBiddingName4(statisVo.getBiddingName());
                    collectVo.setGongChengLiang4(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost4(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost4(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost4(statisVo.getJiXieCost());
                    collectVo.setBhsCount4(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 6) {
                    collectVo.setBiddingName5(statisVo.getBiddingName());
                    collectVo.setGongChengLiang5(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost5(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost5(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost5(statisVo.getJiXieCost());
                    collectVo.setBhsCount5(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 7) {
                    collectVo.setBiddingName6(statisVo.getBiddingName());
                    collectVo.setGongChengLiang6(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost6(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost6(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost6(statisVo.getJiXieCost());
                    collectVo.setBhsCount6(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 8) {
                    collectVo.setBiddingName7(statisVo.getBiddingName());
                    collectVo.setGongChengLiang7(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost7(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost7(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost7(statisVo.getJiXieCost());
                    collectVo.setBhsCount7(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 9) {
                    collectVo.setBiddingName8(statisVo.getBiddingName());
                    collectVo.setGongChengLiang8(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost8(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost8(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost8(statisVo.getJiXieCost());
                    collectVo.setBhsCount8(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 10) {
                    collectVo.setBiddingName9(statisVo.getBiddingName());
                    collectVo.setGongChengLiang9(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost9(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost9(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost9(statisVo.getJiXieCost());
                    collectVo.setBhsCount9(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 11) {
                    collectVo.setBiddingName10(statisVo.getBiddingName());
                    collectVo.setGongChengLiang10(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost10(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost10(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost10(statisVo.getJiXieCost());
                    collectVo.setBhsCount10(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 12) {
                    collectVo.setBiddingName11(statisVo.getBiddingName());
                    collectVo.setGongChengLiang11(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost11(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost11(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost11(statisVo.getJiXieCost());
                    collectVo.setBhsCount11(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 13) {
                    collectVo.setBiddingName12(statisVo.getBiddingName());
                    collectVo.setGongChengLiang12(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost12(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost12(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost12(statisVo.getJiXieCost());
                    collectVo.setBhsCount12(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 14) {
                    collectVo.setBiddingName13(statisVo.getBiddingName());
                    collectVo.setGongChengLiang13(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost13(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost13(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost13(statisVo.getJiXieCost());
                    collectVo.setBhsCount13(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 15) {
                    collectVo.setBiddingName14(statisVo.getBiddingName());
                    collectVo.setGongChengLiang14(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost14(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost14(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost14(statisVo.getJiXieCost());
                    collectVo.setBhsCount14(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 16) {
                    collectVo.setBiddingName15(statisVo.getBiddingName());
                    collectVo.setGongChengLiang15(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost15(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost15(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost15(statisVo.getJiXieCost());
                    collectVo.setBhsCount15(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 17) {
                    collectVo.setBiddingName16(statisVo.getBiddingName());
                    collectVo.setGongChengLiang16(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost16(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost16(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost16(statisVo.getJiXieCost());
                    collectVo.setBhsCount16(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 18) {
                    collectVo.setBiddingName17(statisVo.getBiddingName());
                    collectVo.setGongChengLiang17(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost17(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost17(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost17(statisVo.getJiXieCost());
                    collectVo.setBhsCount17(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 19) {
                    collectVo.setBiddingName18(statisVo.getBiddingName());
                    collectVo.setGongChengLiang18(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost18(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost18(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost18(statisVo.getJiXieCost());
                    collectVo.setBhsCount18(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 20) {
                    collectVo.setBiddingName19(statisVo.getBiddingName());
                    collectVo.setGongChengLiang19(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost19(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost19(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost19(statisVo.getJiXieCost());
                    collectVo.setBhsCount19(statisVo.getBhsCount());
                }
                if (statisVo.getSort() == 21) {
                    collectVo.setBiddingName20(statisVo.getBiddingName());
                    collectVo.setGongChengLiang20(statisVo.getGongChengLiang());
                    collectVo.setRenGongCost20(statisVo.getRenGongCost());
                    collectVo.setFuCaiCost20(statisVo.getFuCaiCost());
                    collectVo.setJiXieCost20(statisVo.getJiXieCost());
                    collectVo.setBhsCount20(statisVo.getBhsCount());
                }
            }
            if (StringUtils.isNotEmpty(collectVo.getXiTongFenLei()) && StringUtils.isNotEmpty(collectVo.getFenXiFenLeiTwo())) {
                collectVoList.add(collectVo);
            }
        }
        //排序并返回
        return collectVoList.stream().filter(vo -> vo.getFenXiFenLeiTwoType() != null)
                .sorted(Comparator.comparingInt(XfgcComparisonOfClassificationCollectVo::getFenXiFenLeiTwoType)).collect(Collectors.toList());
    }

    /**
     * 消防-投标报价横向对比-查看单个供应商
     *
     * @param toList
     * @param supplyCompany
     * @param companyItemList
     * @param jieDuan
     * @return
     */
    public List<XfgcComparisonOfClassificationCollectVo> getComparisonOfClassificationOne(List<XfgcComparisonOfClassificationCollectVo> toList, SupplyCompany supplyCompany, List<XfgcBiddingCompany> companyItemList, Integer jieDuan) {
        if (companyItemList.size() >= 1) {
            List<XfgcTabulation> tabulationList = xfgcTabulationService.getRepository().findByFlagAndXfgcBiddingCompanyIdAndJieDuan(1, companyItemList.get(0).getId(), jieDuan);
            if (tabulationList.size() == 0) {
                for (XfgcComparisonOfClassificationCollectVo vo : toList) {
                    vo.setBiddingName1(null);
                    vo.setBiddingName2(null);
                    vo.setBiddingName3(null);
                    vo.setBiddingName4(null);
                    vo.setBiddingName5(null);
                    vo.setBiddingName6(null);
                    vo.setBiddingName7(null);
                    vo.setBiddingName8(null);
                    vo.setBiddingName9(null);
                    vo.setBiddingName10(null);
                    vo.setBiddingName11(null);
                    vo.setBiddingName12(null);
                    vo.setBiddingName13(null);
                    vo.setBiddingName14(null);
                    vo.setBiddingName15(null);
                    vo.setBiddingName16(null);
                    vo.setBiddingName17(null);
                    vo.setBiddingName18(null);
                    vo.setBiddingName19(null);
                    vo.setBiddingName20(null);
                }
                return toList;
            }
        }
        for (XfgcComparisonOfClassificationCollectVo vo : toList) {
            String supplyName = supplyCompany.getName();
            String[] biddingNames = {
                    vo.getBiddingName1(), vo.getBiddingName2(), vo.getBiddingName3(), vo.getBiddingName4(),
                    vo.getBiddingName5(), vo.getBiddingName6(), vo.getBiddingName7(), vo.getBiddingName8(),
                    vo.getBiddingName9(), vo.getBiddingName10(), vo.getBiddingName11(), vo.getBiddingName12(),
                    vo.getBiddingName13(), vo.getBiddingName14(), vo.getBiddingName15(), vo.getBiddingName16(),
                    vo.getBiddingName17(), vo.getBiddingName18(), vo.getBiddingName19(), vo.getBiddingName20()
            };
            for (int i = 0; i < biddingNames.length; i++) {
                if (supplyName.equals(biddingNames[i])) {
                    for (int j = 0; j < biddingNames.length; j++) {
                        if (j != i) {
                            biddingNames[j] = null;
                        }
                    }
                    break;
                }
            }
            // 设置所有 biddingNames 回 vo 对象
            vo.setBiddingName1(biddingNames[0]);
            vo.setBiddingName2(biddingNames[1]);
            vo.setBiddingName3(biddingNames[2]);
            vo.setBiddingName4(biddingNames[3]);
            vo.setBiddingName5(biddingNames[4]);
            vo.setBiddingName6(biddingNames[5]);
            vo.setBiddingName7(biddingNames[6]);
            vo.setBiddingName8(biddingNames[7]);
            vo.setBiddingName9(biddingNames[8]);
            vo.setBiddingName10(biddingNames[9]);
            vo.setBiddingName11(biddingNames[10]);
            vo.setBiddingName12(biddingNames[11]);
            vo.setBiddingName13(biddingNames[12]);
            vo.setBiddingName14(biddingNames[13]);
            vo.setBiddingName15(biddingNames[14]);
            vo.setBiddingName16(biddingNames[15]);
            vo.setBiddingName17(biddingNames[16]);
            vo.setBiddingName18(biddingNames[17]);
            vo.setBiddingName19(biddingNames[18]);
            vo.setBiddingName20(biddingNames[19]);
        }
        return toList;
    }


    /**
     * 导出投标报价横向对比内容
     *
     * @param sortedList
     * @return
     */
    public XSSFWorkbook exportHxdb(List<XfgcComparisonOfClassificationCollectVo> sortedList) {
        XSSFWorkbook workbook = new XSSFWorkbook();
        Sheet sheet = workbook.createSheet("分类横向对比");
        CellStyle cellStyle = workbook.createCellStyle();
        cellStyle.setAlignment(HorizontalAlignment.CENTER); // 居中
        cellStyle.setVerticalAlignment(VerticalAlignment.CENTER); // 居中
        // 创建日期格式
        CellStyle cellDateStyle = workbook.createCellStyle();
        CreationHelper createHelper = workbook.getCreationHelper();
        cellDateStyle.setDataFormat(createHelper.createDataFormat().getFormat("yyyy-mm-dd hh:mm:ss"));
        Row row0 = sheet.createRow(0);
        createCellAddStype(row0, 0, cellStyle).setCellValue("投标报价横向对比");

        CellRangeAddress titleRegion = new CellRangeAddress(0, 0, 0, 20);// 下标从0开始 起始行号，终止行号， 起始列号，终
        sheet.addMergedRegionUnsafe(titleRegion);
        //边框
        cellStyle.setBorderBottom(BorderStyle.THIN); //下边框
        cellStyle.setBorderLeft(BorderStyle.THIN);//左边框
        cellStyle.setBorderTop(BorderStyle.THIN);//上边框
        cellStyle.setBorderRight(BorderStyle.THIN);//右边框
        cellDateStyle.setBorderBottom(BorderStyle.THIN); //下边框
        cellDateStyle.setBorderLeft(BorderStyle.THIN);//左边框
        cellDateStyle.setBorderTop(BorderStyle.THIN);//上边框
        cellDateStyle.setBorderRight(BorderStyle.THIN);//右边框


        if (sortedList.size() > 0) {
            Row row1 = sheet.createRow(1);
            createCellAddStype(row1, 0, cellStyle).setCellValue("系统");
            createCellAddStype(row1, 1, cellStyle).setCellValue("分项");
            createCellAddStype(row1, 2, cellStyle).setCellValue(sortedList.get(0).getBiddingName());
            createCellAddStype(row1, 3, cellStyle).setCellValue(sortedList.get(0).getBiddingName());
            createCellAddStype(row1, 4, cellStyle).setCellValue(sortedList.get(0).getBiddingName());
            createCellAddStype(row1, 5, cellStyle).setCellValue(sortedList.get(0).getBiddingName());
            createCellAddStype(row1, 6, cellStyle).setCellValue(sortedList.get(0).getBiddingName());
            createCellAddStype(row1, 7, cellStyle).setCellValue(sortedList.get(0).getBiddingName());
            int indexA = 8;
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName1())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName1());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName1());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName2())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName2());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName2());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName3())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName3());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName3());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName4())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName4());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName4());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName5())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName5());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName5());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName6())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName6());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName6());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName7())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName7());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName7());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName8())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName8());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName8());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName9())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName9());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName9());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName10())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName10());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName10());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName11())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName11());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName11());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName12())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName12());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName12());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName13())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName13());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName13());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName14())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName14());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName14());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName15())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName15());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName15());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName16())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName16());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName16());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName17())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName17());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName17());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName18())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName18());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName18());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName19())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName19());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName19());
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName20())) {
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName20());
                createCellAddStype(row1, indexA++, cellStyle).setCellValue(sortedList.get(0).getBiddingName20());
            }
        }

        Row row2 = sheet.createRow(2);
        createCellAddStype(row2, 0, cellStyle).setCellValue("系统");
        createCellAddStype(row2, 1, cellStyle).setCellValue("分项");
        createCellAddStype(row2, 2, cellStyle).setCellValue("工程量");
        createCellAddStype(row2, 3, cellStyle).setCellValue("点位单方");
        createCellAddStype(row2, 4, cellStyle).setCellValue("人工费");
        createCellAddStype(row2, 5, cellStyle).setCellValue("辅材");
        createCellAddStype(row2, 6, cellStyle).setCellValue("机械费");
        createCellAddStype(row2, 7, cellStyle).setCellValue("不含税合计");
        int indexB = 8;
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName1())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName2())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName3())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName4())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName5())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName6())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName7())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName8())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName9())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName10())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName11())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName12())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName13())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName14())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName15())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName16())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName17())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName18())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName19())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
        if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName20())) {
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("工程量");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("人工费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("辅材");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("机械费");
            createCellAddStype(row2, indexB++, cellStyle).setCellValue("不含税合计");
        }
//        CellRangeAddress cra1 = new CellRangeAddress(1, sortedList.size() + 2, 0, 0);
        CellRangeAddress cra2 = new CellRangeAddress(1, 2, 0, 0);
        CellRangeAddress cra3 = new CellRangeAddress(1, 2, 1, 1);
        CellRangeAddress cra4 = new CellRangeAddress(1, 1, 2, 7);
        CellRangeAddress cra5 = new CellRangeAddress(1, 1, 8, 12);
        CellRangeAddress cra6 = new CellRangeAddress(1, 1, 13, 17);
        CellRangeAddress cra7 = new CellRangeAddress(1, 1, 18, 22);
        CellRangeAddress cra8 = new CellRangeAddress(1, 1, 23, 27);
        CellRangeAddress cra9 = new CellRangeAddress(1, 1, 28, 32);
        CellRangeAddress cra10 = new CellRangeAddress(1, 1, 33, 37);
        CellRangeAddress cra11 = new CellRangeAddress(1, 1, 38, 42);
        CellRangeAddress cra12 = new CellRangeAddress(1, 1, 43, 47);
        CellRangeAddress cra13 = new CellRangeAddress(1, 1, 48, 52);
        CellRangeAddress cra14 = new CellRangeAddress(1, 1, 53, 57);
        CellRangeAddress cra15 = new CellRangeAddress(1, 1, 58, 62);
        CellRangeAddress cra16 = new CellRangeAddress(1, 1, 63, 67);
        CellRangeAddress cra17 = new CellRangeAddress(1, 1, 68, 72);
        CellRangeAddress cra18 = new CellRangeAddress(1, 1, 73, 77);
        CellRangeAddress cra19 = new CellRangeAddress(1, 1, 78, 82);
        CellRangeAddress cra20 = new CellRangeAddress(1, 1, 83, 87);
        CellRangeAddress cra21 = new CellRangeAddress(1, 1, 88, 92);
        CellRangeAddress cra22 = new CellRangeAddress(1, 1, 93, 97);
        CellRangeAddress cra23 = new CellRangeAddress(1, 1, 98, 102);
        CellRangeAddress cra24 = new CellRangeAddress(1, 1, 103, 107);
        CellRangeAddress cra25 = new CellRangeAddress(3, 6, 0, 0);
        CellRangeAddress cra26 = new CellRangeAddress(7, 12, 0, 0);

        //在sheet里增加合并单元格
//        sheet.addMergedRegion(cra1);
        sheet.addMergedRegion(cra2);
        sheet.addMergedRegion(cra3);
        sheet.addMergedRegion(cra4);
        sheet.addMergedRegion(cra5);
        sheet.addMergedRegion(cra6);
        sheet.addMergedRegion(cra7);
        sheet.addMergedRegion(cra8);
        sheet.addMergedRegion(cra9);
        sheet.addMergedRegion(cra10);
        sheet.addMergedRegion(cra11);
        sheet.addMergedRegion(cra12);
        sheet.addMergedRegion(cra13);
        sheet.addMergedRegion(cra14);
        sheet.addMergedRegion(cra15);
        sheet.addMergedRegion(cra16);
        sheet.addMergedRegion(cra17);
        sheet.addMergedRegion(cra18);
        sheet.addMergedRegion(cra19);
        sheet.addMergedRegion(cra20);
        sheet.addMergedRegion(cra21);
        sheet.addMergedRegion(cra22);
        sheet.addMergedRegion(cra23);
        sheet.addMergedRegion(cra24);
        sheet.addMergedRegion(cra25);
        sheet.addMergedRegion(cra26);

        Integer rowIndex = 3;
        for (XfgcComparisonOfClassificationCollectVo item : sortedList) {
            Row row = sheet.createRow(rowIndex);
            createCellAddStype(row, 0, cellStyle).setCellValue(item.getXiTongFenLei());
            createCellAddStype(row, 1, cellStyle).setCellValue(item.getFenXiFenLeiTwo());
            createCellAddStype(row, 2, cellStyle).setCellValue(item.getGongChengLiang() != null ? item.getGongChengLiang().toString() : "");
            createCellAddStype(row, 3, cellStyle).setCellValue(item.getBhsCount() != null ? item.getDianWeiDanFang().toString() : "0");
            createCellAddStype(row, 4, cellStyle).setCellValue(item.getRenGongCost() != null ? item.getRenGongCost().toString() : "");
            createCellAddStype(row, 5, cellStyle).setCellValue(item.getFuCaiCost() != null ? item.getFuCaiCost().toString() : "0");
            createCellAddStype(row, 6, cellStyle).setCellValue(item.getJiXieCost() != null ? item.getJiXieCost().toString() : "0");
            createCellAddStype(row, 7, cellStyle).setCellValue(item.getBhsCount() != null ? item.getBhsCount().toString() : "0");
            int indexC = 8;
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName1())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang1() != null ? item.getGongChengLiang1().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost1() != null ? item.getRenGongCost1().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost1() != null ? item.getFuCaiCost1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost1() != null ? item.getJiXieCost1().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount1() != null ? item.getBhsCount1().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName2())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang2() != null ? item.getGongChengLiang2().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost2() != null ? item.getRenGongCost2().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost2() != null ? item.getFuCaiCost2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost2() != null ? item.getJiXieCost2().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount2() != null ? item.getBhsCount2().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName3())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang3() != null ? item.getGongChengLiang3().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost3() != null ? item.getRenGongCost3().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost3() != null ? item.getFuCaiCost3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost3() != null ? item.getJiXieCost3().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount3() != null ? item.getBhsCount3().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName4())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang4() != null ? item.getGongChengLiang4().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost4() != null ? item.getRenGongCost4().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost4() != null ? item.getFuCaiCost4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost4() != null ? item.getJiXieCost4().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount4() != null ? item.getBhsCount4().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName5())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang5() != null ? item.getGongChengLiang5().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost5() != null ? item.getRenGongCost5().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost5() != null ? item.getFuCaiCost5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost5() != null ? item.getJiXieCost5().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount5() != null ? item.getBhsCount5().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName6())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang6() != null ? item.getGongChengLiang6().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost6() != null ? item.getRenGongCost6().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost6() != null ? item.getFuCaiCost6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost6() != null ? item.getJiXieCost6().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount6() != null ? item.getBhsCount6().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName7())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang7() != null ? item.getGongChengLiang7().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost7() != null ? item.getRenGongCost7().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost7() != null ? item.getFuCaiCost7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost7() != null ? item.getJiXieCost7().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount7() != null ? item.getBhsCount7().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName8())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang8() != null ? item.getGongChengLiang8().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost8() != null ? item.getRenGongCost8().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost8() != null ? item.getFuCaiCost8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost8() != null ? item.getJiXieCost8().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount8() != null ? item.getBhsCount8().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName9())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang9() != null ? item.getGongChengLiang9().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost9() != null ? item.getRenGongCost9().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost9() != null ? item.getFuCaiCost9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost9() != null ? item.getJiXieCost9().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount9() != null ? item.getBhsCount9().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName10())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang10() != null ? item.getGongChengLiang10().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost10() != null ? item.getRenGongCost10().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost10() != null ? item.getFuCaiCost10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost10() != null ? item.getJiXieCost10().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount10() != null ? item.getBhsCount10().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName11())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang11() != null ? item.getGongChengLiang11().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost11() != null ? item.getRenGongCost11().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost11() != null ? item.getFuCaiCost11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost11() != null ? item.getJiXieCost11().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount11() != null ? item.getBhsCount11().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName12())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang12() != null ? item.getGongChengLiang12().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost12() != null ? item.getRenGongCost12().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost12() != null ? item.getFuCaiCost12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost12() != null ? item.getJiXieCost12().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount12() != null ? item.getBhsCount12().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName13())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang13() != null ? item.getGongChengLiang13().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost13() != null ? item.getRenGongCost13().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost13() != null ? item.getFuCaiCost13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost13() != null ? item.getJiXieCost13().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount13() != null ? item.getBhsCount13().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName14())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang14() != null ? item.getGongChengLiang14().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost14() != null ? item.getRenGongCost14().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost14() != null ? item.getFuCaiCost14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost14() != null ? item.getJiXieCost14().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount14() != null ? item.getBhsCount14().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName15())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang15() != null ? item.getGongChengLiang15().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost15() != null ? item.getRenGongCost15().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost15() != null ? item.getFuCaiCost15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost15() != null ? item.getJiXieCost15().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount15() != null ? item.getBhsCount15().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName16())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang16() != null ? item.getGongChengLiang16().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost16() != null ? item.getRenGongCost16().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost16() != null ? item.getFuCaiCost16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost16() != null ? item.getJiXieCost16().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount16() != null ? item.getBhsCount16().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName17())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang17() != null ? item.getGongChengLiang17().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost17() != null ? item.getRenGongCost17().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost17() != null ? item.getFuCaiCost17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost17() != null ? item.getJiXieCost17().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount17() != null ? item.getBhsCount17().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName18())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang18() != null ? item.getGongChengLiang18().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost18() != null ? item.getRenGongCost18().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost18() != null ? item.getFuCaiCost18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost18() != null ? item.getJiXieCost18().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount18() != null ? item.getBhsCount18().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName19())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang19() != null ? item.getGongChengLiang19().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost19() != null ? item.getRenGongCost19().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost19() != null ? item.getFuCaiCost19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost19() != null ? item.getJiXieCost19().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount19() != null ? item.getBhsCount19().toString() : "0");
            }
            if (StringUtils.isNotEmpty(sortedList.get(0).getBiddingName20())) {
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getGongChengLiang20() != null ? item.getGongChengLiang20().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getRenGongCost20() != null ? item.getRenGongCost20().toString() : "");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getFuCaiCost20() != null ? item.getFuCaiCost20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getJiXieCost20() != null ? item.getJiXieCost20().toString() : "0");
                createCellAddStype(row, indexC++, cellStyle).setCellValue(item.getBhsCount20() != null ? item.getBhsCount20().toString() : "0");
            }
            rowIndex++;
        }
        return workbook;
    }

}
